home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!lll-winken!sun-barr!newstop!sun!decpa.pa.dec.com
- From: dbs@decpa.pa.dec.com (dan sears)
- Newsgroups: comp.sources.x
- Subject: v07i100: xtiff, Patch3, Part01/01
- Message-ID: <137466@sun.Eng.Sun.COM>
- Date: 18 Jun 90 19:56:03 GMT
- Sender: news@sun.Eng.Sun.COM
- Lines: 151
- Approved: argv@sun.com
-
- Submitted-by: dbs@decpa.pa.dec.com (dan sears)
- Posting-number: Volume 7, Issue 100
- Archive-name: xtiff/patch3
- Patch-To: xtiff: Volume 7, Issue 36 (5/12/90)
- Patch-To: xtiff: Volume 7, Issue 54 (5/17/90) patch1
- Patch-To: xtiff: Volume 7, Issue 80 (5/31/90) patch2
-
- This patch fixes a bug in handling different color masks and byte orders
- for DirectColor visuals.
-
- --Dan Sears
-
- diff -r -c rev2/patchlevel.h rev3/patchlevel.h
- *** rev2/patchlevel.h Tue May 29 19:02:02 1990
- --- rev3/patchlevel.h Mon Jun 18 11:01:30 1990
- ***************
- *** 1 ****
- ! #define PATCHLEVEL 2
- --- 1 ----
- ! #define PATCHLEVEL 3
- diff -r -c rev2/xtiff.c rev3/xtiff.c
- *** rev2/xtiff.c Tue May 29 19:02:03 1990
- --- rev3/xtiff.c Mon Jun 18 11:19:11 1990
- ***************
- *** 4,11 ****
- * Dan Sears
- * Chris Sears
- *
- * Revsion 1.2 90/05/29
- ! * Fixed a bug with MINISWHTE images.
- * Revsion 1.1 90/05/16
- * Fixed a few minor bugs.
- * Revsion 1.0 90/05/07
- --- 4,14 ----
- * Dan Sears
- * Chris Sears
- *
- + * Revsion 1.3 90/06/18
- + * Fixed a bug in handling different color masks and byte orders
- + * for DirectColor visuals.
- * Revsion 1.2 90/05/29
- ! * Fixed a bug with MINISWHITE images.
- * Revsion 1.1 90/05/16
- * Fixed a few minor bugs.
- * Revsion 1.0 90/05/07
- ***************
- *** 559,570 ****
- /*
- * Handle different color masks for different frame buffers.
- */
- ! red_shift = pixel_map[0] = xRedMask == 0xFF000000 ? 3
- ! : (xRedMask == 0xFF0000 ? 2 : (xRedMask == 0xFF00 ? 1 : 0));
- ! green_shift = pixel_map[1] = xGreenMask == 0xFF000000 ? 3
- ! : (xGreenMask == 0xFF0000 ? 2 : (xGreenMask == 0xFF00 ? 1 : 0));
- ! blue_shift = pixel_map[2] = xBlueMask == 0xFF000000 ? 3
- ! : (xBlueMask == 0xFF0000 ? 2 : (xBlueMask == 0xFF00 ? 1 : 0));
-
- if (tfPlanarConfiguration == PLANARCONFIG_CONTIG) {
- for (i = 0; i < tfImageHeight; i++) {
- --- 562,582 ----
- /*
- * Handle different color masks for different frame buffers.
- */
- ! if (ImageByteOrder(xDisplay) == LSBFirst) { /* DECstation 5000 */
- ! red_shift = pixel_map[0] = xRedMask == 0xFF000000 ? 3
- ! : (xRedMask == 0xFF0000 ? 2 : (xRedMask == 0xFF00 ? 1 : 0));
- ! green_shift = pixel_map[1] = xGreenMask == 0xFF000000 ? 3
- ! : (xGreenMask == 0xFF0000 ? 2 : (xGreenMask == 0xFF00 ? 1 : 0));
- ! blue_shift = pixel_map[2] = xBlueMask == 0xFF000000 ? 3
- ! : (xBlueMask == 0xFF0000 ? 2 : (xBlueMask == 0xFF00 ? 1 : 0));
- ! } else { /* Ardent */
- ! red_shift = pixel_map[0] = xRedMask == 0xFF000000 ? 0
- ! : (xRedMask == 0xFF0000 ? 1 : (xRedMask == 0xFF00 ? 2 : 3));
- ! green_shift = pixel_map[0] = xGreenMask == 0xFF000000 ? 0
- ! : (xGreenMask == 0xFF0000 ? 1 : (xGreenMask == 0xFF00 ? 2 : 3));
- ! blue_shift = pixel_map[0] = xBlueMask == 0xFF000000 ? 0
- ! : (xBlueMask == 0xFF0000 ? 1 : (xBlueMask == 0xFF00 ? 2 : 3));
- ! }
-
- if (tfPlanarConfiguration == PLANARCONFIG_CONTIG) {
- for (i = 0; i < tfImageHeight; i++) {
- ***************
- *** 719,748 ****
- void
- EventLoop()
- {
- ! XEvent event;
-
- for (;;) {
- XNextEvent(xDisplay, &event);
-
- switch (event.type) {
- ! case Expose:
- ! if (xPixmapFlag == True) {
- ! if (xImageDepth == 1)
- ! XCopyPlane(xDisplay, xImagePixmap, xWindow, xWinGc,
- event.xexpose.x, event.xexpose.y,
- - event.xexpose.width, event.xexpose.height,
- - event.xexpose.x, event.xexpose.y, 1);
- - else
- - XCopyArea(xDisplay, xImagePixmap, xWindow, xWinGc,
- event.xexpose.x, event.xexpose.y,
- ! event.xexpose.width, event.xexpose.height,
- ! event.xexpose.x, event.xexpose.y);
- ! } else
- ! XPutImage(xDisplay, xWindow, xWinGc, xImage,
- ! event.xexpose.x, event.xexpose.y,
- ! event.xexpose.x, event.xexpose.y,
- ! event.xexpose.width, event.xexpose.height);
- ! break;
- case ButtonPress:
- if (xPixmapFlag == False)
- free(imageMemory);
- --- 731,762 ----
- void
- EventLoop()
- {
- ! XEvent event, button;
-
- for (;;) {
- XNextEvent(xDisplay, &event);
-
- switch (event.type) {
- ! case Expose: /* Let an application quit as fast as possible */
- ! if (!XCheckTypedEvent(xDisplay, ButtonPress, &button)) {
- ! if (xPixmapFlag == True) {
- ! if (xImageDepth == 1)
- ! XCopyPlane(xDisplay, xImagePixmap, xWindow, xWinGc,
- ! event.xexpose.x, event.xexpose.y,
- ! event.xexpose.width, event.xexpose.height,
- ! event.xexpose.x, event.xexpose.y, 1);
- ! else
- ! XCopyArea(xDisplay, xImagePixmap, xWindow, xWinGc,
- ! event.xexpose.x, event.xexpose.y,
- ! event.xexpose.width, event.xexpose.height,
- ! event.xexpose.x, event.xexpose.y);
- ! } else
- ! XPutImage(xDisplay, xWindow, xWinGc, xImage,
- event.xexpose.x, event.xexpose.y,
- event.xexpose.x, event.xexpose.y,
- ! event.xexpose.width, event.xexpose.height);
- ! break;
- ! }
- case ButtonPress:
- if (xPixmapFlag == False)
- free(imageMemory);
-
- dan
- ----------------------------------------------------
- O'Reilly && Associates argv@sun.com / argv@ora.com
- Opinions expressed reflect those of the author only.
-